﻿using System.Web.Mvc;
using Evolus.Mercury.MarketInfoProviders.HoSE;

namespace Evolus.Mercury.Controllers
{
    [HandleError]
    public class PriceboardController : Controller
    {
        IMarketService marketInfoService;

        public PriceboardController(IMarketService marketInfoService)
        {
            this.marketInfoService = marketInfoService;
        }

        public ActionResult Hose()
        {
            HoSEMarketInfoProvider provider = new HoSEMarketInfoProvider();
            return View(provider.GetChanges());
        }

        public ActionResult UpdateHose()
        {
            HoSEMarketInfoProvider provider = new HoSEMarketInfoProvider();
            marketInfoService.UpdateStocks(provider.GetChanges());
            return View();
        }

        public ActionResult HoseListings()
        {
            HoSEMarketInfoProvider provider = new HoSEMarketInfoProvider();
            provider.GetListingStocks();
            return View();
        }
    }
}
